package com.qxzn.app.personalcenter.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.qxzn.app.page.BaseActivity;
import com.qxzn.app.personalcenter.R;
import com.qxzn.app.personalcenter.R2;

import java.io.File;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 注册7-人脸3
 */
public class RegisterFace3Activity extends BaseActivity {

    @BindView(R2.id.iv_face)
    ImageView ivFace;

    @Override
    protected int initLayout() {
        return R.layout.activity_register_face3;
    }

    @Override
    protected void initView() {
    }

    @Override
    protected void iniTitleBar() {
        tv_title.setVisibility(View.GONE);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        File file = (File) getIntent().getSerializableExtra("file");
        if (file != null) {
            Glide.with(this).load(file).apply(RequestOptions.circleCropTransform().placeholder(R.mipmap.logo).error(R.mipmap.logo)).into(ivFace);
        }
    }

    @OnClick({R2.id.iv_retake_photo, R2.id.tv_next})
    public void onViewClicked(View view) {
        int i = view.getId();
        if (i == R.id.iv_retake_photo) {
            finish();
        } else if (i == R.id.tv_next) {
            startActivity(getIntent().setClass(this, RegisterMsgActivity.class));
        }
    }
}
